package io.github.talelin.latticy.mapper.ag;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.github.talelin.latticy.model.ag.RoomDO;
import io.github.talelin.latticy.model.ag.RoomDetailDO;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface RoomMapper extends BaseMapper<RoomDO>{
//    @Select("SELECT r.id,r.building_id,r.name,b.name AS belongBuilding,r.floor,r.manager,r.phone " +
//            "FROM ag_room AS r left JOIN ag_building AS b " +
//            "ON r.building_id=b.id" +
//            "AND r.delete_time IS NULL " +
//            "ORDER BY update_time DESC LIMIT #{page},#{count}")
//    @Results(id = "roomTest",value = {
//            @Result(column = "belongBuilding",property = "belongBuilding")
//    })
//    List<RoomDetailDO> getRoomWithBuilding(Integer page, Integer count);
//}
//    IPage<RoomDO> searchRoomByKeyword(Page<RoomDO> pager, String keyword);
}
